package com.zf.zffencheng.controller;

import com.zf.zffencheng.util.DateUtil;
import io.swagger.annotations.Api;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * ClassName: IndexController <br/>
 * Description:  <br/>
 * date: 2021/5/7 15:56<br/>
 *
 * @author william <br/>
 */
@Api(tags = "测试使用")
public class IndexController {
    private static final String shortDateFormat = "yyyy-MM-dd";
    private static final String shortTimeFormat = "yyyy-MM-dd HH:mm:ss";
    public static void main(String[] args) {

        SimpleDateFormat formatter = new SimpleDateFormat(shortDateFormat);

        String date = formatter.format(new Date());
        System.out.println(date);
        SimpleDateFormat f = new SimpleDateFormat(shortTimeFormat);

        String date2 = f.format(new Date());
        System.out.println(date2);
        System.out.println(formatter.format(DateUtil.addDays(new Date(),1)));
        System.out.println(formatter.format(DateUtil.addDays(new Date(),-1)));
    }
}
